<?php /*a:2:{s:55:"/www/wwwroot/mall/public/template/mall/order/index.html";i:1626419106;s:64:"/www/wwwroot/mall/public/template/mall/../index/public/mlay.html";i:1624501447;}*/ ?>
<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="x-ua-compatible" content="ie=edge">
		<title><?php echo htmlentities((isset($page_title) && ($page_title !== '')?$page_title:config('app.web_site_title'))); ?></title>
		<meta name="keywords" content="<?php echo config('app.web_site_keywords'); ?>">
		<meta name="description" content="<?php echo config('app.web_site_description'); ?>">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, shrink-to-fit=no, user-scalable=no">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		
		
		<!-- Icons -->
		<link rel="icon" href="/static/images/favicon.ico">
		<!-- END Icons -->
		
		<!-- Stylesheets -->
		<link rel="stylesheet" href="/static/libs/weui/css/weui.min.css">
		<link rel="stylesheet" href="/static/libs/weui/css/common.css?v=<?php echo config('app.asset_version'); ?>">
		<link rel="stylesheet" href="/static/css/font/iconfont.css?v=<?php echo config('app.asset_version'); ?>">
		<!-- END Stylesheets -->
		
<style>
	.tabar .active {
		color: #BFA073;
		font-size: 0.85rem;
		font-weight: bold;
		position: relative;
	}

	.buttom {
		display: inline-block;
		background: #e6c358;
		border-radius: 30px;
		font-size: 0.7rem;
		padding: 0.1rem 0.4rem;
	}

	/* .active::before {
		content: "";
		display: block;
		height: 2px;
		background-image: linear-gradient(120deg, #BFA073, #BFA073);
		position: absolute;
		bottom: -5px;
		left: 50%;
		width: 50%;
		transform: translateX(-50%);
	} */
</style>
<!-- 公共css样式在这里 弹性布局也在这里 -->
<link rel="stylesheet" href="/template/static/css/public.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.12/lib/index.css" />

	</head>
	<body id="<?php echo htmlentities(strtolower(app('request')->app())); ?>-<?php echo htmlentities(strtolower(app('request')->controller())); ?>-<?php echo htmlentities(strtolower(app('request')->action())); ?>">
		<!-- Page Container -->
		<div class="page" id="main">
			
			
<div id="app">
	<div class="flex ju_sb tabar"
		style="padding: 0.5rem 1rem;font-size: 0.75rem;position: fixed;top: 0;width: 100%;background: #ffffff;">
		<div @click="tab(item.id)" v-for="(item,index) in Data" :key="item.id" :class="{active:isActive==item.id}"
			class="" v-cloak>
			{{item.title}}
		</div>
	</div>
	<div style="height: 2.5rem;" class=""></div>
	<div v-if="this.List.length!=0" class="">
		<div v-for="(item,index) in List" :key="index" class="bagfff"
			style="border-radius: 0.5rem;margin:0.5rem;padding: 20px 0.5rem;">
			<div class="flex ju_sb ai_center">
				<img style="height: 0.8rem;" v-cloak :src="item.cover">
				<div style="flex: 1;margin-left: 0.5rem;" class="">
					<div class="flex ju_sb">
						<div style="font-size: 0.75rem;flex: 1;" class="" v-cloak>
							{{item.title}}
						</div>
						<div style="font-size: 0.7rem;" class="" v-cloak>
							{{item.pay_time}}
						</div>
					</div>
					<!-- <div style="font-size: 0.6rem;margin-left: 10px;">¥{{item.pay_price}}</div>
				<div style="text-align: right;font-size: 0.65rem;margin: 1rem 0;" class="">
					<span style="color: #C5C5C5;">共{{item.number}}件 </span>小计:<span style="color: #a98c2e;">￥{{item.pay_price}}</span>
				</div> -->
				</div>
			</div>
			<div v-for="(ite,index) in item.list" style="margin-top: 0.5rem;" class="">
				<div class="flex ju_sb">
					<img style="width: 3.75rem;height: 3.75rem;border-radius: 0.5rem;" v-cloak :src="ite.cover">
					<div style="flex: 1;margin-left: 0.5rem;" class="">
						<div class="flex ju_sb">
							<div style="font-size: 0.75rem;flex: 1;" class="" v-cloak>
								{{ite.title}}
							</div>
							<div style="font-size: 0.7rem;" class="" v-cloak>
								{{ite.pay_time}}
							</div>
						</div>
						<div style="font-size: 0.6rem;margin-left: 10px;" v-cloak>¥{{ite.pay_price}}</div>
						<div style="text-align: right;font-size: 0.65rem;margin: 1rem 0;" class="">
							<span style="color: #C5C5C5;" v-cloak>x{{ite.number}} </span><span style="color: #a98c2e;"
								v-cloak>￥{{ite.pay_price}}</span>
						</div>
					</div>
				</div>
			</div>
			<div style="text-align: right;" class="">
				<span @click="pay(item)" class="buttom">查看详情</span>
				<span @click="pay(item)" v-if="item.status==0" class="buttom">
					去付款
				</span>
				<span @click="pay(item)" v-if="item.status==1" class="buttom">
					待发货
				</span>
				<span @click="pay(item)" v-if="item.status==2" class="buttom">
					待收货
				</span>
				<span @click="pay(item)" v-if="item.status==3" class="buttom">
					已完成
				</span>
				<span @click="pay(item)" v-if="item.status==4" class="buttom">
					已退款
				</span>
			</div>
		</div>
	</div>
	<div v-else class="" style="text-align: center;margin-top: 5rem;color: #b3b3b3;">
		<img src="/template/static/img/icon/there_is_no_order.png" >
		<p>您还没有相关的订单</p>
	</div>
</div>

		</div>
		<!-- END Page Container -->
		<!-- FOOT -->
		
		<!-- Copyright -->
		<div class="weui-footer padding-tb">
			<!-- 		<p class="weui-footer__links">
	<a href="javascript:void(0);" class="weui-footer__link">底部链接</a>
	</p> -->
			<p class="weui-footer__text"><?php echo config('app.web_site_copyright'); ?></p>
		</div>
		<!-- Copyright -->
		
		
		<!-- Footer -->
		<!-- 工具栏 -->
		<div class="footer"></div>
		<?php if(!(empty($nav['main_nav']) || (($nav['main_nav'] instanceof \think\Collection || $nav['main_nav'] instanceof \think\Paginator ) && $nav['main_nav']->isEmpty()))): ?>
		<nav class="bar-tab weui-flex">
			<?php if(is_array($nav['main_nav']) || $nav['main_nav'] instanceof \think\Collection || $nav['main_nav'] instanceof \think\Paginator): $i = 0; $__LIST__ = $nav['main_nav'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?>
			<a class="tab-item weui-flex__item<?php if(isset($active) && $active == $menu['rel']): ?> active<?php endif; ?>" href="<?php echo htmlentities($menu['url']); ?>">
				<span class="icoimg <?php echo htmlentities($menu['css']); if(isset($active) && $active == $menu['rel']): ?>-full<?php endif; ?>"></span>
				<span class="tab-label"><?php echo htmlentities($menu['title']); ?></span>
			</a>
			<?php endforeach; endif; else: echo "" ;endif; ?>
		</nav>
		<?php endif; ?>
		<!-- Footer -->
		

		
		<ul id="Fixed">
			<li id="goTop" class="ico ico-up hidden" title="去顶部"></li>
		</ul>
		
		<!-- END FOOT-->
		<div class="hidden">
			
			<?php echo config('app.web_site_statistics'); ?>
			
		</div>
		<!--js -->
		<script src="/static/libs/weui/js/jquery.min.js"></script>
		<script src="/static/libs/weui/js/weui.min.js"></script>
		<script src="/static/libs/weui/js/common.js?<?php echo config('app.asset_version'); ?>"></script>
		
		<?php if(!(empty($jssdk) || (($jssdk instanceof \think\Collection || $jssdk instanceof \think\Paginator ) && $jssdk->isEmpty()))): ?>
		<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
		<script>
			wx.config({
				debug: false,
				appId: '<?php echo htmlentities($jssdk['appid']); ?>',
				timestamp: '<?php echo htmlentities($jssdk['timestamp']); ?>',
				nonceStr: '<?php echo htmlentities($jssdk['noncestr']); ?>',
				signature: '<?php echo htmlentities($jssdk['signature']); ?>',
				jsApiList: [
					'updateAppMessageShareData',
					'updateTimelineShareData',
					'hideMenuItems',
					'showMenuItems',
					'closeWindow',
				],
				openTagList: ['wx-open-launch-weapp']
			});
			wx.ready(function() {
				wx.updateAppMessageShareData({
					title: "<?php echo htmlentities((isset($share['title']) && ($share['title'] !== '')?$share['title']:config('app.web_site_title'))); ?>", // 分享标题
					desc: "<?php echo htmlentities((isset($share['desc']) && ($share['desc'] !== '')?$share['desc']:config('app.web_site_slogan'))); ?>", // 分享描述
					link: "<?php echo htmlentities((isset($share['url']) && ($share['url'] !== '')?$share['url']:$jssdk['url'])); ?>", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
					imgUrl: "<?php echo htmlentities((isset($share['img']) && ($share['img'] !== '')?$share['img']:app('request')->scheme() . '://' .app('request')->host() .'/static/images/share.png')); ?>", // 分享图标
					success: function() {
						// 设置成功
					}
				});
				wx.updateTimelineShareData({
					title:  "<?php echo htmlentities((isset($share['title']) && ($share['title'] !== '')?$share['title']:config('app.web_site_title'))); ?>", // 分享标题
					link: "<?php echo htmlentities((isset($share['url']) && ($share['url'] !== '')?$share['url']:$jssdk['url'])); ?>", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
					imgUrl: "<?php echo htmlentities((isset($share['img']) && ($share['img'] !== '')?$share['img']:app('request')->scheme() . '://' .app('request')->host() .'/static/images/share.png')); ?>", // 分享图标
					success: function() {
						// 设置成功
					}
				});
				<?php if(!(empty($share['hide']) || (($share['hide'] instanceof \think\Collection || $share['hide'] instanceof \think\Paginator ) && $share['hide']->isEmpty()))): ?>
				wx.hideMenuItems({
					menuList: ['menuItem:copyUrl', 'menuItem:originPage', 'menuItem:readMode', 'menuItem:openWithQQBrowser',
						'menuItem:openWithSafari', 'menuItem:share:email', 'menuItem:favorite', 'menuItem:share:qq',
						'menuItem:share:weiboApp', 'menuItem:favorite', 'menuItem:share:QZone'] // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
				});
				<?php endif; ?>
				wx.showMenuItems({
					menuList: ["menuItem:profile", "menuItem:addContact", ] // 要显示的菜单项，所有menu项见附录3
				});
			});
		</script>
		<?php endif; ?>
		
		
<!-- 引入vue.js文件使用vue开发 -->
<script src="/template/static/js/public/vue.min.js" type="text/javascript" charset="utf-8"></script>
<!-- vant -->
<script src="/template/static/js/public/vant-2.12.min.js" type="text/javascript" charset="utf-8"></script>
<script>
	var active = "<?php echo htmlentities(app('request')->param('status')); ?>";
	console.log(active)
	if (active == '' && active <= 0) {
		active = 99
	}
	var vm = new Vue({
		el: "#app",
		data() {
			return {
				isActive: active,
				Data: <?php echo json_encode($status); ?>,
				List: [],
				page: 1, //页数
				last_page: '', //总页数
				isLoadding: false,
			}
		},
		//计算属性	
		computed: {},
		//监听属性
		watch: {},
		//钩子函数	
		created() {
			this.shuju()
		},
		mounted() {
			window.addEventListener('scroll', this.handleScroll); // 监听滚动事件，然后用handleScroll这个方法进行相应的处理
		},
		methods: {
			handleScroll() {
				//变量scrollTop是滚动条滚动时，距离顶部的距离
				var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
				//变量windowHeight是可视区的高度
				var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
				//变量scrollHeight是滚动条的总高度
				var scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
				//滚动条到底部的条件
				if (scrollTop + windowHeight >= scrollHeight && vm.isLoadding == false) {
					//加载数据的函数
					// console.log("距顶部" + scrollTop + "可视区高度" + windowHeight + "滚动条总高度" + scrollHeight);
					if (this.page < this.last_page) {
						this.page++
						this.shuju();
					}
				}
			},
			tab(index) {
				this.isActive = index
				window.location.href = "<?php echo real_url('mall/order/index'); ?>/status/" + index
			},
			shuju: function() {
				let that = this
				var loading = weui.loading('loading', {
					content: '正在载入'
				});
				$.post("", {
					page: that.page
				}, function(res) {
					that.last_page = res.data.last_page //最后页数
					// that.List = res.data.items
					if (that.page > 1) {
						that.List = that.List.concat(res.data.items);
						console.log(that.List);
						that.show = true
					} else {
						that.List = res.data.items
					}
					loading.hide();
					console.log(that.List);
					console.log(res);
				});
			},
			pay(item) {
				console.log(item.id)
				window.location.href = "<?php echo real_url('mall/order/detail'); ?>/id/" + item.id
			},
		}
	})
	//  返回到指定页面
	// history.pushState(history.length-1, " ", window.location.href.split('#')[0] + "#" + new Date().getTime());
	// if (navigator.userAgent.indexOf('Android') != -1) {
	//    if (typeof(tbsJs) != "undefined") {
	//      tbsJs.onReady('{useCachedApi : "true"}', function(e) {});
	//      window.onhashchange = function() {
	//        location.href = 'https://mall.anheyuan.cn/user/member/index.html';
	//      };
	//    } else {
	//      window.onhashchange = function(event) {
	//          history.go(-1);
	//      };
	//    }
	//  } else {
	//    window.onhashchange = function() {
	//        location.href = 'https://mall.anheyuan.cn/user/member/index.html';	
	//    };
	//  }
</script>

	</body>
</html>
